#ifndef MODIFYDIALOG_H
#define MODIFYDIALOG_H

#include <QtGui>
#include <QDialog>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
#include <QSpacerItem>

class modifyDialog: public QDialog
{
    Q_OBJECT
public:
    modifyDialog(int i,QWidget *parent = 0);
    ~modifyDialog();
private:
    QString source;
    QString content;
    int id;

    QSqlDatabase db;

    QVBoxLayout * vlayout;
    QHBoxLayout * hlayout_source;
    QHBoxLayout * hlayout_content;
    QHBoxLayout * hlayout_button;

    QLabel * label_source;
    QLabel * label_content;
    QLineEdit * line_source;
    QTextEdit * text_content;

    QPushButton * button_ok;
    QPushButton * button_cancel;
    QSpacerItem * spacer_button;
private slots:
   // void insert(QSqlDatabase &db);
    void insert();
    void update();
    void enable_Ok();
};

#endif // MODIFYDIALOG_H
